package com.zfsmart.component.common.bean.authcenter.entity.wechat.message.model;


import com.zfsmart.component.common.bean.authcenter.entity.wechat.message.MsgType;
import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 * 微信事件消息基类
 */
public abstract class EventMsg extends BaseMsg {
    // 事件类型
    @XStreamAlias("Event")
    private String event;
    @XStreamAlias("EventKey")
    private String eventKey;

    public String getEventKey() {
        return eventKey;
    }

    public void setEventKey(String eventKey) {
        this.eventKey = eventKey;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public boolean isClickEvent() {
        return MsgType.EventType.CLICK.name().equalsIgnoreCase(event);
    }

    public boolean isViewEvent() {
        return MsgType.EventType.VIEW.name().equalsIgnoreCase(event);
    }

    public boolean isSubscribeEvent() {
        return MsgType.EventType.subscribe.name().equalsIgnoreCase(event);
    }

    public boolean isUnsubscribeEvent() {
        return MsgType.EventType.unsubscribe.name().equalsIgnoreCase(event);
    }

    public boolean isScanEvent() {
        return MsgType.EventType.SCAN.name().equalsIgnoreCase(event);
    }

    public boolean isLocationEvent() {
        return MsgType.EventType.LOCATION.name().equalsIgnoreCase(event);
    }
}
